import request from '@/utils/request'

// 获取预约列表
export function getAppointmentList(params) {
  return request({
    url: '/api/appointments/list',
    method: 'get',
    params
  })
}

// 更新预约状态
export function updateAppointmentStatus(id, status) {
  return request({
    url: `/api/appointments/${id}/status`,
    method: 'put',
    params: { status }
  })
}

// 获取预约详情
export function getAppointmentDetail(id) {
  return request({
    url: `/api/appointments/${id}`,
    method: 'get'
  })
}

// 确认预约
export function confirmAppointment(id) {
  return request({
    url: `/api/admin/appointments/${id}/confirm`,
    method: 'put'
  })
}

// 驳回预约
export function rejectAppointment(id, reason) {
  return request({
    url: `/api/admin/appointments/${id}/reject`,
    method: 'put',
    data: { reason }
  })
}

// 导出预约数据
export function exportAppointments(params) {
  return request({
    url: '/api/appointments/export',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 获取预约统计数据
export function getAppointmentStats() {
  return request({
    url: '/api/admin/appointments/stats',
    method: 'get'
  })
} 